<%--
  Created by IntelliJ IDEA.
  User: 储依明
  Date: 2020/7/20
  Time: 21:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录测试</title>
</head>
<body>
<%
    if (session.getAttribute("username") == null) {
%>
<form action="/Session/ServletDemo02" method="get" autocomplete="off">
    用户名:<input type="text" name="username"><br>
    <button type="submit">登录</button>
</form>
<%
    } else {
        out.write("登录成功: " + session.getAttribute("username"));
    }
%>
</body>
</html>